{% extends "./common/layout.html" %} {% block head %}

<link rel="stylesheet" href="/public/home/css/index.css" />

{% endblock %} {% block content %}

<div class="container">
  <div class="index-content">
    <div class="index-content__title">获取小说资源</div>
    <div class="index-content__cont">
      <div class="form">
        <div class="form-inline">
          <label class="form-inline__label">网址：</label>
          <input
            id="inputNovel"
            class="input form-inline__input"
            style="width:80%;"
            type="text"
            value=""
            placeholder="请输入网址"
          />
        </div>
        <div class="form-inline">
          <label class="form-inline__label">章节节点：</label>
          <input
            id="chapterElement"
            class="input form-inline__input"
            style="width:80%;"
            type="text"
            value=""
            placeholder="例如：.list > li a[target]"
          />
        </div>
        <div class="form-inline">
          <label class="form-inline__label"></label>
          <button class="button primary" onclick="getNovelSection()">
            获取章节列表
          </button>
        </div>
        <div id="getChapterCont" style="display: none;">
          <div class="form-inline">
            <label class="form-inline__label">内容节点：</label>
            <input
              id="contentElement"
              class="input form-inline__input"
              style="width:80%;"
              type="text"
              value=""
              placeholder="例如：.content p"
            />
          </div>
          <div class="form-inline">
            <label class="form-inline__label"></label>
            <button class="button primary" onclick="getNovelContentBySection()">
              获取章节内容
            </button>
          </div>
        </div>
      </div>
      <div id="chapterContent" class="data">
        <div class="data-hint mb-md">所有章节列表已获取完成，列表如下：</div>
        <ul id="chapterList" class="section-list"></ul>
      </div>
      <div id="contentCont" class="data">
        <div class="data-hint mb-md">
          所有章节内容已获取完成，可点击下方按钮进行下载：
        </div>
        <a id="download" class="button primary" href="" download="">
          下载TXT
        </a>
      </div>
    </div>
  </div>
  <div class="index-content">
      <div class="index-content__title">获取页面全屏截图</div>
      <div class="index-content__cont form">
          <div class="form-inline">
              <label class="form-inline__label">网址：</label>
              <input id="inputImg" class="input form-inline__input" style="width:80%;" type="text" value="" placeholder="请输入网址"/>
          </div>
          <div class="form-inline">
              <label class="form-inline__label"></label>
              <button class="button primary" onclick="getImgOrPdf(1)">获取截图</button>
              <button class="button defult ml-sm" onclick="reset($('#inputImg'))">重置</button>
          </div>
      </div>            
  </div>
  <div class="index-content">
      <div class="index-content__title">获取页面PDF</div>
      <div class="index-content__cont">
          <div class="hint">温馨提示：有些网页获取后会缺少部分样式（字体或者颜色等），而且请求超时问题比较严重</div>
          <div class="form">
              <div class="form-inline">
                  <label class="form-inline__label">网址：</label>
                  <input id="inputPdf" class="input form-inline__input" style="width:80%;" type="text" value="" placeholder="请输入网址"/>
              </div>
              <div class="form-inline">
                  <label class="form-inline__label"></label>
                  <button class="button primary" onclick="getImgOrPdf(2)">获取PDF</button>
                  <button class="button defult ml-sm" onclick="reset($('#inputPdf'))">重置</button>
              </div>
          </div>
      </div>
  </div>
  <div class="index-content">
      <div class="index-content__title">获取页面数据</div>
      <div class="index-content__cont">
          <div class="form">
              <div class="form-inline">
                  <label class="form-inline__label">网址：</label>
                  <input id="inputData" class="input form-inline__input" style="width:80%;" type="text" value="" placeholder="请输入网址"/>
              </div>
              <div class="form-inline">
                  <label class="form-inline__label">爬取节点：</label>
                  <input id="inputElement" class="input form-inline__input" style="width:80%;" type="text" value="" placeholder="例如：.list > li a[target]"/>
              </div>
              <div class="form-inline">
                  <label class="form-inline__label"></label>
                  <button class="button primary" onclick="getPageData()">获取数据</button>
                  <button class="button defult ml-sm" onclick="resetPageData()">重置</button>
              </div>
          </div>
          <div id="dataContent" class="data">
              <div class="data-hint">获取到的数据如下：</div>
              <ul id="dataList" class="section-list">
              </ul>
          </div>
      </div>
  </div>
</div>
{% endblock %} {% block script %}

<script src="/public/home/js/index.js"></script>

{% endblock %}
